﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Rabbit.Domain;
using Rabbit.DTO.Input;
using Rabbit.DTO.Output;
using Rabbit.Service;

namespace Rabbit.WebApi.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ImagesController : ControllerBase
    {

        ImagesService res;
        public ImagesController(ImagesService res)
        {
            this.res = res;
        }

        /// <summary>
        /// 添加图片
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public IActionResult AddImage(ImagesInput input)
        {
            return Ok(res.AddImage(input));
        }
        /// <summary>
        /// 图片显示
        /// </summary>
        /// <param name="tmid"></param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetImages(int tmid)
        {
            return Ok(res.GetImages(tmid));
        }
        /// <summary>
        /// 删除图片
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [HttpDelete]
        public IActionResult DelImage(int ids)
        {
            return Ok(res.DelImage(ids));
        }




        }
}
